import { formatBigNumber } from "./format";
export let hoverdate = {};

export function getTooltip(): any {
    return {
        trigger: "axis",
        padding: 0,
        borderWidth: 0,
        backgroundColor: "none",
        axisPointer: {
            axis: "x",
            type: "line",
            lineStyle: {
                color: "#464C52"
            },
            label: {
                backgroundColor: "#f00"
            }
        },
        formatter: function (params: any) {
            // console.log("yzt鼠标悬浮数据", params);
            hoverdate = params;
            let ary = params.map((i: any) => {
                return `<div>${i.marker} ${i.seriesName}:  $${formatBigNumber(i.value)}</div>`;
            });
            return `<div class="cw-tooltip">
            <h4>${params[0].axisValue}</h4>
            ${ary.join("")}
            </div>`;
        }
    };
}
